/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package th.model;

import java.io.Serializable;
import java.util.Date;
import javax.persistence.Basic;
import javax.persistence.Column;
import javax.persistence.Embedded;
import javax.persistence.Entity;
import javax.persistence.Id;
import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;
import javax.persistence.Table;
import javax.persistence.Temporal;
import javax.persistence.TemporalType;

/**
 *
 * @author fikri
 */
@Entity
@Table(name = "jadual_penerbangan")
@NamedQueries({
    @NamedQuery(name = "JadualPenerbangan.findAll", query = "SELECT j FROM JadualPenerbangan j")})
public class JadualPenerbangan implements Serializable {
    private static final long serialVersionUID = 1L;
    @Id
    @Basic(optional = false)
    @Column(name = "tahun_hijrah")
    private String tahunHijrah;
    @Basic(optional = false)
    @Column(name = "tahun_masihi")
    private String tahunMasihi;
    @Basic(optional = false)
    @Column(name = "trh_mula")
    @Temporal(TemporalType.TIMESTAMP)        
    private Date trhMula;
    @Basic(optional = false)
    @Column(name = "trh_tamat")
    @Temporal(TemporalType.TIMESTAMP)
    private Date trhTamat;
    @Embedded
    private InfoAudit infoAudit;

    public JadualPenerbangan() {
    }

    public JadualPenerbangan(String tahunHijrah) {
        this.tahunHijrah = tahunHijrah;
    }

    public String getTahunHijrah() {
        return tahunHijrah;
    }

    public void setTahunHijrah(String tahunHijrah) {
        this.tahunHijrah = tahunHijrah;
    }

    public String getTahunMasihi() {
        return tahunMasihi;
    }

    public void setTahunMasihi(String tahunMasihi) {
        this.tahunMasihi = tahunMasihi;
    }

    public Date getTrhMula() {
        return trhMula;
    }
    
    public void setTrhMula(Date trhMula) {
        this.trhMula = trhMula;
    }

    public Date getTrhTamat() {
        return trhTamat;
    }

    public void setTrhTamat(Date trhTamat) {
        this.trhTamat = trhTamat;
    }

    public InfoAudit getInfoAudit() {
        return infoAudit;
    }

    public void setInfoAudit(InfoAudit infoAudit) {
        this.infoAudit = infoAudit;
    }    

    @Override
    public int hashCode() {
        int hash = 0;
        hash += (tahunHijrah != null ? tahunHijrah.hashCode() : 0);
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof JadualPenerbangan)) {
            return false;
        }
        JadualPenerbangan other = (JadualPenerbangan) object;
        if ((this.tahunHijrah == null && other.tahunHijrah != null) || (this.tahunHijrah != null && !this.tahunHijrah.equals(other.tahunHijrah))) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "th.model.JadualPenerbangan[ tahunHijrah=" + tahunHijrah + " ]";
    }
    
}
